import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Router } from '@angular/router';
import { HttpService } from '../service/http.service';

@Component({
  selector: 'app-authorizedlogin',
  templateUrl: './authorizedlogin.component.html',
  styleUrls: ['./authorizedlogin.component.css'],
  encapsulation: ViewEncapsulation.None
})
export class AuthorizedloginComponent implements OnInit {

  constructor(private router: Router, private httpservice: HttpService) { }
type:boolean;
  ngOnInit() {
    const intype = sessionStorage.getItem("intype");
    if(intype=="1"){
      this.type = true;
    }else{
      sessionStorage.setItem("intype","1");
    }
   
    this.getopenidurl();
  }
  getopenidurl() {
    if (sessionStorage.getItem('brid') != null) {
      if(this.type){
        this.router.navigate(['/outpatientpay/scanoutpatientpay']);
      }
      
    }else{
      this.router.navigate(['/hospinfo/hospindex']);
    }
  }
}

